import CommonTable from '@/components/CommonTable';
import { formatSeconds } from '@/utils/format';

const Stations = (props) => {
  const { data } = props;
  const columns = [
    {
      title: '序号',
      dataIndex: 'number',
      width: 65,
      render: (text, record, index) => index + 1,
    },
    {
      title: '司机',
      dataIndex: 'realname',
    },
    {
      title: '站点名称',
      dataIndex: 'stationName',
    },
    {
      title: '进入时间',
      dataIndex: 'inTime',
    },
    {
      title: '离开时间',
      dataIndex: 'outTime',
    },
    {
      title: '时长',
      dataIndex: 'duration',
      render: (text) => formatSeconds(text),
    },
  ];
  return <CommonTable dataSource={data} columns={columns} pagination={false} />;
};

export default Stations;
